import Layout from "@/views/layout/index";

const classRoomRouter = {
  path: "/classroom",
  name: "classroom",
  component: Layout,
  meta: {
    title: "班级管理",
    icon: "iconfont icon-contract"
  },
  redirect: "/classroom/manage",
  children: [
    {
      path: "manage",
      name: "classRoomManage",
      component: () => import("@/views/classroom/manage"),
      meta: {
        title: "班级列表",
        icon: "iconfont icon-contract",
        api: ["classroom"],
        authority: ["own", "list", "create", "edit", "details", "delete"]
      },
      checkedList: [],
      rights: [
        {
          value: "list",
          label: "列表"
        },
        {
          value: "own",
          label: "只看自己"
        },
        {
          value: "create",
          label: "添加"
        },
        {
          value: "details",
          label: "详情"
        },
        {
          value: "edit",
          label: "编辑"
        },
        {
          value: "delete",
          label: "删除"
        }
      ]
    },
    {
      path: "info",
      name: "classroomInfo",
      hidden: true,
      component: () => import("@/views/classroom/info"),
      hidden: true,
      meta: {
        title: "班级详情",
        api: ["classroom"],
        authority: ["own", "list", "create", "edit", "details", "delete"]
      }
    },

    // 教师路由
    {
      path: "list",
      name: "teacherList",
      component: () => import("@/views/teacher/list"),
      meta: {
        title: "教师列表",
        icon: "iconfont icon-jiaoshiguanli",
        api: ["teacher"],
        authority: ["own", "list", "create", "edit", "details", "delete"]
      },
      checkedList: [],
      rights: [
        {
          value: "list",
          label: "列表"
        },
        {
          value: "own",
          label: "只看自己"
        },
        {
          value: "create",
          label: "添加"
        },
        {
          value: "details",
          label: "详情"
        },
        {
          value: "edit",
          label: "编辑"
        },
        {
          value: "delete",
          label: "删除"
        }
      ]
    },
    {
      path: "info",
      name: "teacherInfo",
      component: () => import("@/views/teacher/info"),
      hidden: true,
      meta: {
        title: "编辑教师",
        api: ["teacher"],
        authority: ["own", "list", "create", "edit", "details", "delete"]
      }
    }
  ]
};

export default classRoomRouter;
